#!/usr/bin/env bash

user=""
passwd=""
server=""
lib=""

while getopts "u:p:s:l:" opt; do
  case $opt in
    u)
      user=$OPTARG
      ;;
    p)
      passwd=$OPTARG
      ;;
    s)
      server=$OPTARG
      ;;
    l)
      lib=$OPTARG
      ;;
    \?)
      echo "Invalid option: -$OPTARG"
      ;;
  esac
done


docker login -u $user -p $passwd $server
docker pull $server/$lib
docker tag $server/$lib $lib

echo "docker pull completed"